<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws.
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/modules/Gallery/classes/PhpFox_ComponentRecentImages.class.php, $Author:  $ */



/** Component for showing recent images list
 *
 * @version $Id: PhpFox_ComponentRecentImages.class.php 46 2007-12-14 23:12:21Z phpfoxsv $
 * @package module.gallery
 */
class PhpFox_Mod_Gallery_ComponentRecentImages extends BaseComponent
{
    function process()
    {
        $oSecurityService = App::getModuleService('Account', 'Security');
        /* @var $oSecurityService PhpFox_Mod_Account_ServiceSecurity */
        $oTpl = $this->_oModule->getTemplate();

        if (!$oSecurityService->checkAccess('gallery', '', false))
        {
            return '';
        }

       	$iPageSize = $this->getParam('iNumImages', 3);
       	$aItems = $this->oDatabase->getRows('SELECT id FROM '. App::getT('main') .'
       		WHERE allow = "" AND who_view = ""
       		ORDER BY id DESC LIMIT 0,'. $iPageSize .'');

        $oTpl->assign(array(
        	'aItems'     => $aItems,
        	'sGImageUrl' => App::getParam('gallery.pic.url'),
        ));
        return $oTpl->fetch('RecentImages.html');
    }
}
?>